import { ref } from 'vue'

export const searchFormRules = ref([
    {
        type: 'input',
        props: {
            label: '用户名',
            prop: 'username',
            placeholder: '请输入用户名',
        },
    },
    {
        type: 'input',
        props: {
            label: '手机号码',
            prop: 'mobile',
            placeholder: '请输入手机号码',
        },
    },
    {
        type: 'select',
        props: {
            label: '状态',
            prop: 'status',
            placeholder: '请选择状态',
        },
        options: [
            {
                label: '正常',
                value: 0,
                elTagClass: 'success',
            },
            {
                label: '禁用',
                value: 1,
                elTagClass: 'danger',
            },
        ],
    },
])

export const tableHead = [
    {
        type: 'index',
    },
    {
        label: '用户名',
        prop: 'username',
        width: 200,
    },
    {
        label: '手机号码',
        prop: 'mobile',
    },
    {
        label: '电邮地址',
        prop: 'email',
    },
    {
        type: 'slot:status',
        label: '状态',
        prop: 'status',
    },
    {
        type: 'slot:createdAt',
        label: '创建时间',
        prop: 'createdAt',
    },
    {
        type: 'actionBar',
        label: '操作',
        width: 300,
        data: [
            {
                text: '修改',
                props: {
                    icon: 'Edit',
                },
            },
            {
                text: '删除',
                props: {
                    icon: 'Delete',
                },
            },
            {
                text: '默认密码',
                props: {
                    icon: 'Refresh',
                },
            },
        ],
    },
]
